package com.simtop.hj.service.imp;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.simtop.hj.common.ServerResponse;
import com.simtop.hj.mapper.WineMapper;
import com.simtop.hj.pojo.*;
import com.simtop.hj.service.WineService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.*;

@Service
public class WineServiceImpl implements WineService {

    @Autowired
    public WineMapper wineMapper;


    private Logger logger= LoggerFactory.getLogger(WineServiceImpl.class);

    @Override
    public ServerResponse<List> getWineWorldSaleTheme() {
        List<SaleTheme> saleThemeList=wineMapper.getWineWorldSaleTheme();
        return ServerResponse.createBySuccess(saleThemeList);
    }

    @Override
    public ServerResponse<List> getWineWorldSaleYear(Integer themeId) {
        List<String> yearList=new ArrayList<>();
        if(themeId==1){
            yearList=wineMapper.getWineWorldSaleYear("yield");
        }else if(themeId==2){
            yearList=wineMapper.getWineWorldSaleYear("export");
        }else if(themeId==3){
            yearList=wineMapper.getWineWorldSaleYear("imports");
        }else if(themeId==4){
            yearList=wineMapper.getWineWorldSaleYear("sell");
        }else if(themeId==5){
            yearList=wineMapper.getWineWorldSaleYear("avg_sell");
        }else if(themeId==6){
            yearList=wineMapper.getWineWorldSaleYear("grow_area");
        }else if(themeId==7){
            yearList=wineMapper.getWineWorldSaleYear("grape_yield");
        }
        return ServerResponse.createBySuccess(yearList);
    }

    @Override
    public List<WineWorld> getWineWorldSale(String year, Integer themeId) {
        List<WineProduction> wineProductionList=new ArrayList<>();
        String yield="";
        List<WineWorld> wineWorldList=new ArrayList<>();
//        StringBuilder countrySb=new StringBuilder();
//        StringBuilder countSb=new StringBuilder();
        if(themeId==1){
            yield="yield";
            wineProductionList=wineMapper.getWineWorldSale(yield,year);
            wineProductionList.forEach(wineProduction -> {
                WineWorld wineWorld=new WineWorld();
                wineWorld.setName(wineProduction.getCountry());
                wineWorld.setValue(wineProduction.getYield());
                wineWorldList.add(wineWorld);
            });
        }else if(themeId==2){
            yield="export";
            wineProductionList=wineMapper.getWineWorldSale(yield,year);
            wineProductionList.forEach(wineProduction -> {
                WineWorld wineWorld=new WineWorld();
                wineWorld.setName(wineProduction.getCountry());
                wineWorld.setValue(wineProduction.getExport());
                wineWorldList.add(wineWorld);
            });
        }else if(themeId==3){
            yield="imports";
            wineProductionList=wineMapper.getWineWorldSale(yield,year);
            wineProductionList.forEach(wineProduction -> {
                WineWorld wineWorld=new WineWorld();
                wineWorld.setName(wineProduction.getCountry());
                wineWorld.setValue(wineProduction.getImports());
                wineWorldList.add(wineWorld);
            });
        }else if(themeId==4){
            yield="sell";
            wineProductionList=wineMapper.getWineWorldSale(yield,year);
            wineProductionList.forEach(wineProduction -> {
                WineWorld wineWorld=new WineWorld();
                wineWorld.setName(wineProduction.getCountry());
                wineWorld.setValue(wineProduction.getSell());
                wineWorldList.add(wineWorld);
            });
        }else if(themeId==5){
            yield="avg_sell";
            wineProductionList=wineMapper.getWineWorldSale(yield,year);
            wineProductionList.forEach(wineProduction -> {
                System.out.println(wineProduction.getCountry()+wineProduction.getAvgSell());
                WineWorld wineWorld=new WineWorld();
                wineWorld.setName(wineProduction.getCountry());
                wineWorld.setValue(wineProduction.getAvgSell());
                wineWorldList.add(wineWorld);
            });
        }else if(themeId==6){
            yield="grow_area";
            wineProductionList=wineMapper.getWineWorldSale(yield,year);
            wineProductionList.forEach(wineProduction -> {
                WineWorld wineWorld=new WineWorld();
                wineWorld.setName(wineProduction.getCountry());
                wineWorld.setValue(wineProduction.getGrowArea());
                wineWorldList.add(wineWorld);
            });
        }else if(themeId==7){
            yield="grape_yield";
            wineProductionList=wineMapper.getWineWorldSale(yield,year);
            wineProductionList.forEach(wineProduction -> {
                WineWorld wineWorld=new WineWorld();
                wineWorld.setName(wineProduction.getCountry());
                wineWorld.setValue(wineProduction.getGrapeYield());
                wineWorldList.add(wineWorld);
            });
        }
//        String[] country=countrySb.toString().split(",");
//        String[] count=countSb.toString().split(",");
//        WineWorldSale wineWorldSale=new WineWorldSale();
//        wineWorldSale.setCountry(country);
//        wineWorldSale.setCount(count);
        return wineWorldList;
    }

    @Override
    public List<String> getWineNationYear() {
        return wineMapper.getWineNationYear();
    }

    @Override
    public Object getWineNationYieldSale(String year,Integer choseWineCategory) {
        WineNationYieldSale wineNationYieldSale=new WineNationYieldSale();
        if(choseWineCategory==2){
            List<WineNationwideYield> wineNationwideYieldList=wineMapper.getWineNationSale(year);
            List<WineNation> wineNationYieldList=new ArrayList<>();
            wineNationwideYieldList.forEach(wineNationwideYield -> {
                WineNation wineNation=new WineNation();
                wineNation.setName(wineNationwideYield.getYieldArea().replace("市","").replace("省",""));
                if(StringUtils.isEmpty(wineNationwideYield.getYieldAccount())){
                    wineNation.setValue((double) 0);
                }else{
                    wineNation.setValue(wineNationwideYield.getYieldAccount());
                }
                wineNationYieldList.add(wineNation);
            });
            wineNationYieldSale.setWineNationYield(wineNationYieldList);
        }else if(choseWineCategory==1){
            List<WineNationwideSale> wineNationwideSaleList=wineMapper.getWineNationYield(year);
            List<WineNation> wineNationSaleList=new ArrayList<>();
            wineNationwideSaleList.forEach(wineNationwideSale -> {
                WineNation wineNation=new WineNation();
                wineNation.setName(wineNationwideSale.getSaleArea().replace("市","").replace("省",""));
                if(StringUtils.isEmpty(wineNationwideSale.getSaleAccount())){
                    wineNation.setValue((double) 0);
                }else{
                    wineNation.setValue(wineNationwideSale.getSaleAccount());
                    wineNation.setValue(wineNationwideSale.getSaleAccount());
                }
                wineNationSaleList.add(wineNation);
            });
            wineNationYieldSale.setWineNationSale(wineNationSaleList);
        }
        return wineNationYieldSale;
    }

    @Override
    public Object getWineNationwideSale(String year) {
        List<WineNationwideSale> wineNationwideSaleList=wineMapper.getWineNationwideSale(year);
        StringBuilder wineNationwideSaleArea=new StringBuilder();
        StringBuilder wineNationwideSaleAccount=new StringBuilder();
        wineNationwideSaleList.forEach(wineNationwideSale -> {
            wineNationwideSaleArea.append(wineNationwideSale.getSaleArea()).append(",");
//            Integer account=wineNationwideSale.getSaleAccount().intValue();
            wineNationwideSaleAccount.append(wineNationwideSale.getSaleAccount().intValue()).append(",");
        });
        WineWorldSale wineWorldSale=new WineWorldSale();
        wineWorldSale.setCountry(wineNationwideSaleArea.toString().split(","));
        wineWorldSale.setCount(wineNationwideSaleAccount.toString().split(","));
        return wineWorldSale;
    }


    @Override
    public Object getWineNationCountrySale(String beginYear, String endYear,Integer countrySum) {
        Map<String,String[]> resultMap=new HashMap<>();
        List<String> year=wineMapper.getWineWorldSaleYearByCondition(beginYear,endYear);
        List<String> country=wineMapper.getWineWorldSaleCountry(beginYear,endYear,countrySum);
        Map<String,String> countryMap=new HashMap<>();
        for (String s : country) {
            countryMap.put(s,"");
        }
        for (Map.Entry<String, String> entry : countryMap.entrySet()) {
            List<WineProduction> wineProductionList=wineMapper.getWineProduction(beginYear,endYear,entry.getKey());
            StringBuilder resultSB=new StringBuilder();
            wineProductionList.forEach(wineProduction -> {
                resultSB.append(wineProduction.getSell()).append(",");
            });
            resultMap.put(entry.getKey(),resultSB.toString().split(","));
        }
        ResultWineNationCountry resultWineNationCountry=new ResultWineNationCountry();
        resultWineNationCountry.setYear(year.toArray(new String[year.size()]));
        List<String[]> sellList=new ArrayList<>();
        StringBuilder countrySb=new StringBuilder();
        for (String s : country) {
            sellList.add(resultMap.get(s));
        }
//        for (Map.Entry<String, String[]> entry : resultMap.entrySet()) {
//            countrySb.append(entry.getKey()).append(",");
//            sellList.add(entry.getValue());
//        }
        resultWineNationCountry.setCountry(country.toArray(new String[country.size()]));
        resultWineNationCountry.setSell(sellList);
        return resultWineNationCountry;
    }


//    @Override
//    public List<String> getContentParticiple() {
//        return wineMapper.getContentParticiple();
//    }


    @Override
    public ServerResponse getEmotionResult() {
        List<EmotionResult> emotionResultList=wineMapper.getEmotionResult();
        return ServerResponse.createBySuccess(emotionResultList);
    }

    @Override
    public ServerResponse getDirtyData(Integer num,Integer wineNum) {
        /**
         * 产地脏数据
         */
        List<DirtyData> originDirtyData=wineMapper.getOriginDirtyData();
        /**
         *容量脏数据
         */
        List<DirtyData> capacityDirtyData=wineMapper.getCapacityDirtyData(num);
        /**
         * 酒类脏数据
         */
        List<DirtyData> wineDirtyData=wineMapper.getWineDirtyData(wineNum);

        /**
         * 品类脏数据
         */
        List<DirtyData> categoryDirtyData=wineMapper.getCategoryDirtyData();
        DirtyResultData dirtyResultData=new DirtyResultData();
        dirtyResultData.setOriginDirtyData(originDirtyData);
        dirtyResultData.setCapacityDirtyData(capacityDirtyData);
        dirtyResultData.setWineDirtyData(wineDirtyData);
        dirtyResultData.setCategoryDirtyData(categoryDirtyData);
        return ServerResponse.createBySuccess(dirtyResultData);
    }


    @Override
    public ServerResponse getDirtyDataSet(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<DirtyData> dirtyDataSet=wineMapper.getDirtyDataSet();
        PageInfo<DirtyData> pageInfo=new PageInfo<>(dirtyDataSet);
        return ServerResponse.createBySuccess(pageInfo);
    }

    @Override
    public ServerResponse getBrandStandard() {
        int brandNum=new Random().nextInt(5)+1;
        List<DirtyData> dirtyDataList=wineMapper.getBrandStandard(brandNum);
//        for (DirtyData dirtyData : dirtyDataList) {
//            if(brandNum==1){
//                dirtyData.setBrand("干露");
//            }else if(brandNum==2){
//                dirtyData.setBrand("纷赋");
//            }else if(brandNum==3){
//                dirtyData.setBrand("纷赋");
//            }else if(brandNum==4){
//                dirtyData.setBrand("露仙歌");
//            }else if(brandNum==5){
//                dirtyData.setBrand("纷赋");
//            }
//        }
        BrandStandardResult brandStandardResult=new BrandStandardResult();
        brandStandardResult.setBrandStandard(dirtyDataList);
        brandStandardResult.setBrandNum(brandNum);
        return ServerResponse.createBySuccess(brandStandardResult);
    }

    @Override
    public ServerResponse getSubsidiaryBrandStandard() {
        int subsidiaryBrandNum=new Random().nextInt(4)+1;
        List<DirtyData> dirtyDataList=wineMapper.getSubsidiaryBrandStandard(subsidiaryBrandNum);
//        for (DirtyData dirtyData : dirtyDataList) {
//            if(subsidiaryBrandNum==1){
//                dirtyData.setBrand("奔富洛神山庄");
//            }else if(subsidiaryBrandNum==2){
//                dirtyData.setBrand("奔富寇兰山");
//            }else if(subsidiaryBrandNum==3){
//                dirtyData.setBrand("纷赋灰牌");
//            }else if(subsidiaryBrandNum==4){
//                dirtyData.setBrand("纷赋黑牌");
//            }
//        }
        BrandStandardResult brandStandardResult=new BrandStandardResult();
        brandStandardResult.setBrandStandard(dirtyDataList);
        brandStandardResult.setBrandNum(subsidiaryBrandNum);
        return ServerResponse.createBySuccess(brandStandardResult);
    }

    @Override
    public ServerResponse getProductStandard(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<DirtyData> dirtyDataList=wineMapper.getProductStandard();
        PageInfo<DirtyData> productInfo=new PageInfo<>(dirtyDataList);
        return ServerResponse.createBySuccess(productInfo);
    }

    @Override
    public ServerResponse getRawDataSet(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<DirtyData> rawDataSetList=wineMapper.getRawDataSet();
        PageInfo<DirtyData> rawDataSetInfo=new PageInfo<>(rawDataSetList);
        return ServerResponse.createBySuccess(rawDataSetInfo);
    }


    @Override
    public ServerResponse getDataStandardByBottle(Integer pageNum,Integer pageSize,Integer bottleNum) {
        List<DataStandard> dataStandardList=new ArrayList<>();
        PageHelper.startPage(pageNum,pageSize);
        if(bottleNum==1){
            dataStandardList=wineMapper.getDataStandardByBottleSex();
        }else if(bottleNum==2){
            dataStandardList=wineMapper.getDataStandardByBottleTwo();
        }
        PageInfo<DataStandard> standardPageInfo=new PageInfo<>(dataStandardList);
        return ServerResponse.createBySuccess(standardPageInfo);
    }

    @Override
    public ServerResponse getDataStandardByUpdate(Integer serialNumber) {
        /**
         * 1:瓶数=2；2：瓶数=6；3：单凭价格=价格/瓶数
         */
        int updateNum=new Random().nextInt(3)+1;
        List<DirtyData> dirtyDataList=wineMapper.getDataStandardByUpdate(serialNumber);
        if(updateNum==1){
        }else if(updateNum==1){
            dirtyDataList.forEach(dirtyData -> {
                dirtyData.setBottle(2);
            });
        }else if(updateNum==2){
            dirtyDataList.forEach(dirtyData -> {
                dirtyData.setBottle(6);
            });
        }else if(updateNum==3){
            dirtyDataList.forEach(dirtyData -> {
                dirtyData.setSinglePrice(String.valueOf(Double.parseDouble(dirtyData.getPagePrice())/(double)dirtyData.getBottle()));
            });
        }
        return ServerResponse.createBySuccess(dirtyDataList);
    }

    @Override
    public ServerResponse getDataStandard(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<DirtyData> dataStandard=wineMapper.getDataStandard();
        PageInfo<DirtyData> dataStandardInfo=new PageInfo<>(dataStandard);
        return ServerResponse.createBySuccess(dataStandardInfo);
    }


    @Override
    public ServerResponse getMissingValue(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<DirtyData> missValue=wineMapper.getMissingValue();
        PageInfo<DirtyData> missValueInfo=new PageInfo<>(missValue);
        return ServerResponse.createBySuccess(missValueInfo);
    }

    @Override
    public ServerResponse getTastingAdvanced(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<DirtyData>  tastingAdvanced=wineMapper.getTastingAdvanced();
        PageInfo<DirtyData> dirtyData=new PageInfo<>(tastingAdvanced);
        return ServerResponse.createBySuccess(dirtyData);
    }

    @Override
    public ServerResponse getFine(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<DirtyData> fineData=wineMapper.getFine();
        PageInfo<DirtyData> fineInfo=new PageInfo<>(fineData);
        return ServerResponse.createBySuccess(fineInfo);
    }


    @Override
    public ServerResponse getGrapeVariety(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<DirtyData> grapeVariety=wineMapper.getGrapeVariety();
        PageInfo<DirtyData> grapeVarietyInfo=new PageInfo<>(grapeVariety);
        return ServerResponse.createBySuccess(grapeVarietyInfo);
    }

    @Override
    public ServerResponse getPriceData(Integer pageNum, Integer pageSize) {
        Integer num=10;
        PageHelper.startPage(pageNum,pageSize);
        List<StatisticsData> statisticsData=wineMapper.getPriceData(num);
        PageInfo<StatisticsData> statisticsDataPageInfo=new PageInfo<>(statisticsData);
        return ServerResponse.createBySuccess(statisticsDataPageInfo);
    }

    @Override
    public ServerResponse getCharacterNumeration(Integer pageNum, Integer pageSize) {
        Integer num=11;
        PageHelper.startPage(pageNum,pageSize);
        List<StatisticsData> statisticsData=wineMapper.getPriceData(num);
        PageInfo<StatisticsData> statisticsDataPageInfo=new PageInfo<>(statisticsData);
        return ServerResponse.createBySuccess(statisticsDataPageInfo);
    }

    @Override
    public ServerResponse getDataNormal(Integer pageNum, Integer pageSize) {
        Integer num=12;
        PageHelper.startPage(pageNum,pageSize);
        List<StatisticsData> statisticsData=wineMapper.getPriceData(num);
        PageInfo<StatisticsData> statisticsDataPageInfo=new PageInfo<>(statisticsData);
        return ServerResponse.createBySuccess(statisticsDataPageInfo);
    }


    @Override
    public ServerResponse getMachineLearning(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<StatisticsDataCopy> statisticsDataCopies=wineMapper.getMachineLearning();
        PageInfo<StatisticsDataCopy> statisticsDataCopyPageInfo=new PageInfo<>(statisticsDataCopies);
        return ServerResponse.createBySuccess(statisticsDataCopyPageInfo);
    }

    @Override
    public ServerResponse getCustomsRiskControl() {
        List<CustomsRisk> customsRiskList=wineMapper.getCustomsRiskControl();
        Collections.shuffle(customsRiskList);
        return ServerResponse.createBySuccess(customsRiskList);
    }

    @Override
    public ServerResponse getPlatformWarn() {
        List<PlatformWarn> platformWarnList=wineMapper.getPlatformWarn();
        Collections.shuffle(platformWarnList);
        return ServerResponse.createBySuccess(platformWarnList);
    }

    @Override
    public ServerResponse getBusiness() {
        List<Business> businessList=wineMapper.getBusiness();
        Collections.shuffle(businessList);
        return ServerResponse.createBySuccess(businessList);
    }

    @Override
    public ServerResponse getWineFans(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<WineFans> wineFansList=wineMapper.getWineFans();
        PageInfo<WineFans> wineFansPageInfo=new PageInfo<>(wineFansList);
        return ServerResponse.createBySuccess(wineFansPageInfo);
    }

    @Override
    public ServerResponse getJdComment(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<JdComment> jdCommentList=wineMapper.getJdComment(1);
        PageInfo<JdComment> jdCommentPageInfo=new PageInfo<>(jdCommentList);
        return ServerResponse.createBySuccess(jdCommentPageInfo);
    }


    @Override
    public ServerResponse getJdCommentExcept(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<JdComment> jdCommentList=wineMapper.getJdComment(2);
        PageInfo<JdComment> jdCommentPageInfo=new PageInfo<>(jdCommentList);
        return ServerResponse.createBySuccess(jdCommentPageInfo);
    }


    @Override
    public ServerResponse getProductWord(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<ProductWord> productWordList=wineMapper.getProductWord();
        PageInfo<ProductWord> productWordPageInfo=new PageInfo<>(productWordList);
        return ServerResponse.createBySuccess(productWordPageInfo);
    }


    @Override
    public ServerResponse getProductDimension() {
        List<ProductDimension> productDimensionList=wineMapper.getProductDimension();
        return ServerResponse.createBySuccess(productDimensionList);
    }


    @Override
    public ServerResponse getProductEmotion(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<ProductEmotion> productEmotionList=wineMapper.getProductEmotion();
        PageInfo<ProductEmotion> productEmotionPageInfo=new PageInfo<>(productEmotionList);
        return ServerResponse.createBySuccess(productEmotionPageInfo);
    }

    @Override
    public ServerResponse getNegativeProductEmotion(Integer pageNum, Integer pageSize,Integer num) {
        PageHelper.startPage(pageNum,pageSize);
        List<NegativeProductEmotion> negativeProductEmotionList=wineMapper.getNegativeProductEmotion(num);
//        negativeProductEmotionList.forEach(negativeProductEmotion -> {
//            negativeProductEmotion.setName(negativeProductEmotion.getEmotionalWord());
//            negativeProductEmotion.setValue(negativeProductEmotion.getWordFrequency());
//        });
        PageInfo<NegativeProductEmotion> negativeProductEmotionPageInfo=new PageInfo<>(negativeProductEmotionList);
        return ServerResponse.createBySuccess(negativeProductEmotionPageInfo);
    }

    @Override
    public ServerResponse getTextAnalysis(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<TextAnalysis> textAnalysisList=wineMapper.getTextAnalysis();
        PageInfo<TextAnalysis> textAnalysisPageInfo=new PageInfo<>(textAnalysisList);
        return ServerResponse.createBySuccess(textAnalysisPageInfo);
    }

    @Override
    public ServerResponse getTextAnalysisFrequency(Integer pageNum, Integer pageSize,Integer num) {
        PageHelper.startPage(pageNum,pageSize);
        List<TextAnalysisFrequency> textAnalysisFrequencyList=wineMapper.getTextAnalysisFrequency(num);
        PageInfo<TextAnalysisFrequency> textAnalysisFrequencyPageInfo=new PageInfo<>(textAnalysisFrequencyList);
        return ServerResponse.createBySuccess(textAnalysisFrequencyPageInfo);
    }

    @Override
    public ServerResponse getBaiDuNews(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<BaiDuNews> baiDuNewsList=wineMapper.getBaiDuNews();
        PageInfo<BaiDuNews> baiDuNewsPageInfo=new PageInfo<>(baiDuNewsList);
        return ServerResponse.createBySuccess(baiDuNewsPageInfo);
    }

    @Override
    public ServerResponse getSinaNews(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<SinaNews> sinaNewsList=wineMapper.getSinaNews();
        PageInfo<SinaNews> sinaNewsPageInfo=new PageInfo<>(sinaNewsList);
        return ServerResponse.createBySuccess(sinaNewsPageInfo);
    }

    @Override
    public ServerResponse getWbTopic(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<WbTopic> wbTopicList=wineMapper.getWbTopic();
        PageInfo<WbTopic> wbTopicPageInfo=new PageInfo<>(wbTopicList);
        return ServerResponse.createBySuccess(wbTopicPageInfo);
    }

    @Override
    public ServerResponse getZHWD(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<ZHWD> zhwdList=wineMapper.getZHWD();
        PageInfo<ZHWD> zhwdPageInfo=new PageInfo<>(zhwdList);
        return ServerResponse.createBySuccess(zhwdPageInfo);
    }
}
